<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
/**
 *用户的登录
 */
Route::get('/login','UserLoginController@index');
Route::post('/login','UserLoginController@doLogin');
/**
 * 退出登录
 */
Route::get('/loginout','UserLoginController@loginOut');
/**
 * 用户管理
 */
Route::group(['middleware' => 'user'], function () {
	Route::controller('/users','UserController');
});

/**
 * 用户注册
 */
Route::get('/sign','SignController@index');
/**
 * 执行用户注册数据的插入
 */
Route::post('/sign','SignController@doSign');
/**
 * 博客文章的增删改查
 */
Route::resource('/blog','BlogController');
/**
 * 相册资源
 */
Route::get('/xiang','xiangController@index');
Route::post('/xiang','xiangController@Doxiang');
Route::get('/list/{id}','zhaoController@list');
Route::post('/dolist','zhaoController@dolist');
Route::resource('/bianji','zhaoController@bianji');
/**
 * 购物车路由
 */
Route::get('/cart','cartController@index');
/**
 * 添加购物车
 */
Route::get('/addcart/{id}', 'cartController@addcart');
Route::get('/cart/info', 'cartController@cartinfo');
Route::get('/delete', 'cartController@destroy');
Route::get('/del/{rowid}', 'cartController@del');
/**
 * 无限级分类
 */
Route::resource('/cate','CateController');